package org.grow.client.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import org.grow.zero.apis.NumberTwoBillService;
import org.grow.zero.dto.DealBillEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: xwg
 * @CreateDate: 21-8-18
 */

@RestController
public class NumberTwoController {
//    @Autowired
    @Reference
    private NumberTwoBillService numberTwoBillService;

    @GetMapping("/testUnix")
    public String testUnix(){

        System.out.println("controller received");
        return numberTwoBillService.unixTime();

    }

    @PostMapping("/deal")
    public String deal(@RequestBody DealBillEntity dealBillEntity){
        System.out.println(dealBillEntity);
        int i = numberTwoBillService.insertDeal(dealBillEntity);
        return "gogogo"+i;
    }
}
